<?php
declare (strict_types = 1);
namespace app\admin\controller;
use app\common\controller\Backend;
use think\facade\View;

class Tag extends Backend
{
    public function initialize() {
        parent::initialize();
        $this->_mod  = new \app\admin\model\Tag();
    }

    public function _before_index(){
        $where = array();
        $keyword =  request()->param('keyword');
        if($keyword) $where[]=array('name','like','%'.$keyword.'%');
        View::assign('search', array(
            'keyword'=>$keyword,
        ));
        $this->_list($this->_mod, $where, 'id', 'desc');
    }

}


